import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/application/Inventory_system/daily_inspection_checklist_entity.dart';

DailyInspectionChecklistEntity $DailyInspectionChecklistEntityFromJson(Map<String, dynamic> json) {
  final DailyInspectionChecklistEntity dailyInspectionChecklistEntity = DailyInspectionChecklistEntity();
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    dailyInspectionChecklistEntity.id = id;
  }
  final String? riskName = jsonConvert.convert<String>(json['riskName']);
  if (riskName != null) {
    dailyInspectionChecklistEntity.riskName = riskName;
  }
  final String? controllable = jsonConvert.convert<String>(json['controllable']);
  if (controllable != null) {
    dailyInspectionChecklistEntity.controllable = controllable;
  }
  final String? damageTypeId = jsonConvert.convert<String>(json['damageTypeId']);
  if (damageTypeId != null) {
    dailyInspectionChecklistEntity.damageTypeId = damageTypeId;
  }
  final String? damageType = jsonConvert.convert<String>(json['damageType']);
  if (damageType != null) {
    dailyInspectionChecklistEntity.damageType = damageType;
  }
  final String? controlMeasures = jsonConvert.convert<String>(json['controlMeasures']);
  if (controlMeasures != null) {
    dailyInspectionChecklistEntity.controlMeasures = controlMeasures;
  }
  final String? checkContent = jsonConvert.convert<String>(json['checkContent']);
  if (checkContent != null) {
    dailyInspectionChecklistEntity.checkContent = checkContent;
  }
  return dailyInspectionChecklistEntity;
}

Map<String, dynamic> $DailyInspectionChecklistEntityToJson(DailyInspectionChecklistEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['riskName'] = entity.riskName;
  data['controllable'] = entity.controllable;
  data['damageTypeId'] = entity.damageTypeId;
  data['damageType'] = entity.damageType;
  data['controlMeasures'] = entity.controlMeasures;
  data['checkContent'] = entity.checkContent;
  return data;
}

extension DailyInspectionChecklistEntityExtension on DailyInspectionChecklistEntity {
  DailyInspectionChecklistEntity copyWith({
    String? id,
    String? riskName,
    String? controllable,
    String? damageTypeId,
    String? damageType,
    String? controlMeasures,
    String? checkContent,
  }) {
    return DailyInspectionChecklistEntity()
      ..id = id ?? this.id
      ..riskName = riskName ?? this.riskName
      ..controllable = controllable ?? this.controllable
      ..damageTypeId = damageTypeId ?? this.damageTypeId
      ..damageType = damageType ?? this.damageType
      ..controlMeasures = controlMeasures ?? this.controlMeasures
      ..checkContent = checkContent ?? this.checkContent;
  }
}
